<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="赵鹤阳">
    <title>下拉菜单</title>
    <style>
        body {
            margin: 0;
        }

        nav {
            width: 100%;
            height: 50px;
            background-color: #ddd;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        a {
            text-decoration: none;
            font-size: 18px;
        }

        .container {
            width: 1000px;
            margin: 0 auto;
            background-color: #bbb;
        }

        .nav-list {
            line-height: 50px;
            display: flex;
            justify-content: space-around;
        }

        .nav-list>li {
            position: relative;
            height: 50px;
            width: 90px;
        }

        .nav-list>li>a {
            color: #fff;
        }

        .company {
            position: absolute;
            width: 150px;
            height: 160px;
            border: 1px solid #bbb;
            top: 50px;
            left: -40px;
            text-align: center;
            display: none;
        }

        .company li {
            width: 100%;
        }

        .company li a {
            color: #bbb;
        }
    </style>
</head>

<body>
    <nav>
        <div class="container">
            <ul class="nav-list">
                <li>
                    <a href="#">公司简介</a>
                    <ul class="company">
                        <li><a href="#">概况介绍</a></li>
                        <li><a href="#">发展历史</a></li>
                        <li><a href="#">公司实力</a> </li>
                    </ul>
                </li>
                <li><a href="#">产品介绍</a>
                    <ul class="company">
                        <li><a href="#">软件研发</a></li>
                        <li><a href="#">软件教育</a></li>
                        <li><a href="#">天使投资</a></li>
                    </ul>
                </li>
                <li><a href="#">联系我们</a>
                    <ul class="company">
                        <li><a href="#">公司地址</a></li>
                        <li><a href="#">联系方式</a></li>
                        <li><a href="#">投资加盟</a></li>
                    </ul>
                </li>
                <li><a href="#">人才招聘</a>
                    <ul class="company">
                        <li><a href="#">Java招聘</a></li>
                        <li><a href="#">HTML5招聘</a></li>
                        <li><a href="#">PHP招聘</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <script src="./jquery.js"></script>
</body>

</html>
<script>
    $('.nav-list>li').each(function (index) {
        $(this).hover(function () {
            $('.company').eq(index).css('display', 'block');
        }, function () {
            $('.company').eq(index).css('display', 'none');
        });
        $('.company li').each(function (index) {
            $(this).hover(function () {
                $('.company>li>a').eq(index).css('text-decoration', 'underline');
            }, function () {
                $('.company>li>a').eq(index).css('text-decoration', 'none');
            });
        });
        $('.nav-list>li>a').each(function (index) {
            $(this).hover(function () {
                $('.nav-list>li>a').eq(index).css({ 'text-decoration': 'underline', 'color': 'orange' });
            }, function () {
                $('.nav-list>li>a').eq(index).css({ 'text-decoration': 'none', 'color': '' });
            })
        })

    });

</script>